<?php

namespace common\models\orders;

use Yii;
use yii\behaviors\TimestampBehavior;
/**
 * This is the model class for table "orders".
 *
 * @property integer $id
 * @property integer $mid
 * @property string $memname
 * @property string $memphone
 * @property string $name
 * @property string $ordersn
 * @property integer $paytime
 * @property integer $num
 * @property string $payway
 * @property string $paymoney
 * @property string $realmoney
 * @property string $invoicemoney
 * @property integer $isinvoice
 * @property integer $starttime
 * @property integer $endtime
 * @property string $paycategory
 * @property integer $status
 * @property integer $created_at
 * @property integer $updated_at
 */
class Orders extends \yii\db\ActiveRecord
{
    public function behaviors()
    {
        return [
            [
                'class' => TimestampBehavior::className(),
            ],
        ];
    }
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'orders';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['mid', 'paytime', 'num', 'isinvoice', 'starttime', 'endtime', 'status'], 'integer'],
            [['memname', 'memphone', 'name', 'ordersn', 'payway', 'paymoney', 'realmoney', 'invoicemoney', 'paycategory'], 'string', 'max' => 255],
            [['ordersn'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'mid' => Yii::t('app', '用户ID'),
            'memname' => Yii::t('app', '用户名'),
            'memphone' => Yii::t('app', '用户电话'),
            'name' => Yii::t('app', '产品名'),
            'ordersn' => Yii::t('app', '订单号'),
            'paytime' => Yii::t('app', '支付时间'),
            'num' => Yii::t('app', '数量'),
            'payway' => Yii::t('app', '付款方式'),
            'paymoney' => Yii::t('app', '付款金额'),
            'realmoney' => Yii::t('app', '实际金额'),
            'invoicemoney' => Yii::t('app', '发票金额'),
            'isinvoice' => Yii::t('app', '是否开具发票'),
            'starttime' => Yii::t('app', '开始时间'),
            'endtime' => Yii::t('app', '结束时间'),
            'paycategory' => Yii::t('app', '支付类型'),
            'status' => Yii::t('app', '状态'),
            'created_at' => Yii::t('app', '创建时间'),
            'updated_at' => Yii::t('app', '更新时间'),
        ];
    }
}
